<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page trimDirectiveWhitespaces="true" %>
<%@ page session="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>失物详情</title>
<link rel="stylesheet" href="${pageContext.request.contextPath }/css/reset1.css">
<link rel="stylesheet" href="${pageContext.request.contextPath }/css/index.css">

<link rel="stylesheet" href="${pageContext.request.contextPath }/css/bootstrap.min.css" />
<link rel="stylesheet" href="${pageContext.request.contextPath }/css/style3.css" />
<script src="${pageContext.request.contextPath }/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/bootstrap.min.js" ></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/indexseo.js" ></script>
<script src="${pageContext.request.contextPath }/js/slider.js"></script>
<script src="${pageContext.request.contextPath }/js/navChange.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.validate.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/messages_zh.js" ></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.cookie.js"></script>
<script type="text/javascript">
var E3MALL = {
		checkLogin : function(){
			var _ticket = $.cookie("token");
			if(!_ticket){
				return ;
			}
			$.ajax({
				url : "${pageContext.request.contextPath }/user/token/" + _ticket,
				dataType : "jsonp",
				type : "GET",
				success : function(data){
					if(data.status == 200){
						var username = data.data.username;
						/* alert("hello"+username); */
						/* var html = username + "，欢迎您！<a href=\"http://www.e3mall.cn/user/logout.html\" class=\"link-logout\">[退出]</a>"; */
						var html = "<div class='navbar-right' style='display: inline-block;padding-top: 10px;'>"+
				          "<div class=''>"+
				          	"<ol class='list-inline'>"+
				          		"<li>欢迎您,<font style='color: red;'>"+username+"</font></li>|"+
				          		"<li><a href='${pageContext.request.contextPath}/user/logout/"+_ticket+"' class='link-logout'>[退出]</a></li>"+
				          	"</ol>"+
				          "</div>"+
				          "</div>";
						$("#loginbar").html(html);
					}
				}
			});
		}
	}

	$(function(){
		
		// 查看是否已经登录，如果已经登录查询登录信息
		E3MALL.checkLogin();
		
	});
</script>
<script type="text/javascript">
$(function(){
	//用户留言
	var id = $("#lid").val();
	var str = "";
	if(id != ""){
		$.post(
				"<%=basePath%>lost/Lostmeaasge",
				{"lid":id},
				function (data) {
					for(var i = 0;i<data.length;i++){
						str += "<h5>"+data[i].founder+":</h5>"+
						"<li>"+data[i].lmessage+"</li>"+
						"<div style='clear:both;'><hr style='background-color: #111111;height: 1px;'/></div>"
					}
					$("#lmessage").val("");
					$("#lmessageList").html(str);
				}
			);
	}
});
</script>
<script type="text/javascript">
 function save(){
	 $.post(
			 "<%=basePath%>lost/losmessage",
			 $("#messageForm").serialize(),
			 function (data){
				 alert("发言成功!");
				 $("#lmessage").val("");
				 window.location.reload();
			 }
			 
	 );
 }
</script>

<style>	
  /* Make the image fully responsive */
.carousel-inner img {
     width: 100%;
     height: 100%;
}
</style>
</head>
<body style="overflow-x:hidden;padding-bottom: 50px;">

	<jsp:include page="/WEB-INF/jsp/head.jsp"></jsp:include>
		
		<!--新闻标题列表-->
		<div class="container">
			<div class="col-lg-2">
				
			</div>
			
			<div class="col-lg-8 col-lg-offset-2" style="border: 1px solid #E7E7E7;background-color: antiquewhite;padding-top: 5px;">
				<div class="row">
					<!--标题-->
					<h4>详情:</h4>
					<div class="col-lg-8" style="background-color: antiquewhite; padding-top: 5px;padding-bottom: 20px;">
						<form class="form-horizontal" role="form">
							
							<div class="form-group" style="padding-bottom: 1px;">
								<label class="col-sm-2 control-label">品种:</label>
								<div class="col-sm-10">
									<c:if test="${lostInfo.lostkind==1 }">
										<p class="form-control-static">狗狗</p>
									</c:if>
									<c:if test="${lostInfo.lostkind==2 }">
										<p class="form-control-static">狗狗</p>
									</c:if>
									<c:if test="${lostInfo.lostkind==3 }">
										<p class="form-control-static">狗狗</p>
									</c:if>
								</div>
								<div style="clear:both;"><hr style="background-color: #111111;height: 1px;"/></div>
							</div>
							
							<div class="form-group" style="padding-top: 0px;">
								<label class="col-sm-2 control-label">性别:</label>
								<div class="col-sm-10">
								
									<p class="form-control-static">${lostInfo.lostsex==1?"男":"女" }</p>
								</div>
								<div style="clear:both;"><hr style="background-color: #111111;height: 1px;"/></div>
							</div>
							
							<div class="form-group" style="padding-bottom: 1px;">
								<label class="col-sm-2 control-label">颜色:</label>
								<div class="col-sm-10">
									<p class="form-control-static">${lostInfo.lostcolor }</p>
								</div>
								<div style="clear:both;"><hr style="background-color: #111111;height: 1px;"/></div>
							</div>
							
							<div class="form-group" style="padding-bottom: 1px;">
								<label class="col-sm-2 control-label">丢失地点:</label>
								<div class="col-sm-10">
									<p class="form-control-static">${lostInfo.lostaddress }</p>
								</div>
								<div style="clear:both;"><hr style="background-color: #111111;height: 1px;"/></div>
							</div>
							
							<div class="form-group" style="padding-bottom: 1px;">
								<label class="col-sm-2 control-label">丢失时间:</label>
								<div class="col-sm-10">
									<p class="form-control-static">${lostInfo.losttime }</p>
								</div>
								<div style="clear:both;"><hr style="background-color: #111111;height: 1px;"/></div>
							</div>
							<div class="form-group" style="padding-bottom: 1px;">
								<label class="col-sm-2 control-label">联系人:</label>
								<div class="col-sm-10">
									<p class="form-control-static">${lostInfo.lostman }</p>
								</div>
								<div style="clear:both;"><hr style="background-color: #111111;height: 1px;"/></div>
							</div>

							<!--<span><hr style="background-color: #111111;height: 1px;"/></span>-->
							
						</form>
					</div>
					<!--图片,宠物名字-->
					<div class="col-lg-4" style="background-color: antiquewhite;text-align:center; padding-top: 5px;padding-bottom: 20px;">
						<span>
							<div style="background: black; padding: 0px;" class="img-thumbnail">
								<img class="img-responsive img-rounded" style="height: 200px;width: 200px;" src="${lostInfo.lostimage }">
								<font style="color: #21A9E7;font-size: xx-large;">${lostInfo.lostname }</font>
						</div>
						</span>
					</div>
					
				</div>
				
				<!--描述-->
				<div class="row">
					<h4>描述:</h4>
					<!--<hr style="background-color: #111111;height: 1px;"/>-->
					
					<div class="col-lg-12" style="margin: auto;">
						<p>${lostInfo.lostdesc }</p>
					</div>
				</div>
				
				
				<!--提交留言-->
				<div class="row" style="padding-top: 10px;">
					<div class="col-lg-12">
						<!--留言表单-->
						<form class="form-horizontal" role="form" id="messageForm" <%-- action="${pageContext.request.contextPath }/lost/losmessage" --%> method="post">
						<div class="form-group">
							<!--动物的id-->
							<input type="hidden" id="lid" name="lid" value="${lostInfo.id }"/>
							<input type="hidden" id="founder" name="founder" value="${user.username }"/>
							<input type="hidden" id="pname" name="pname" value="${lostInfo.lostname }"/>
							<label for="lmessage" class="col-sm-2 control-label">给我们留言</label>
							<div class="col-sm-10">
								<textarea id="lmessage" name="lmessage" style="width: 400px;"></textarea>
							</div>
						</div>
						<div class="form-group">
							<div class="col-sm-offset-2 col-sm-10">
								<button type="button" class="btn btn-primary" onclick="save()">提交</button>
								
							</div>
							<div style="clear:both;"><hr style="background-color: #111111;height: 1px;"/></div>
						</div>
					</form>
					</div>
				</div>
				<div class="row" style="padding-top: 10px;">
					
					<!--留言展示-->
					<div class="col-lg-1"></div>
					
					<div class="col-lg-8 col-lg-offset-3" style="margin: auto;">
						<ul id="lmessageList">
							
							<h5>王五:</h5>
							<li>在实打实打算发现了</li>
							<div style="clear:both;"><hr style="background-color: #111111;height: 1px;"/></div>
							<h5>王五:</h5>
							<li>在实打实打算发现了</li>
							<div style="clear:both;"><hr style="background-color: #111111;height: 1px;"/></div>
							<h5>王五:</h5>
							<li>在实打实打算发现了</li>
							<div style="clear:both;"><hr style="background-color: #111111;height: 1px;"/></div>
						</ul>
					
					</div>
				</div>
				
			</div>
		</div>

  

   
		
		
		<!--底层-->
		<nav class="navbar-fixed-bottom">
			<header class="header" style="background-color: gainsboro;">
		      <div class="container1">
		      	
		        <ul class="nav" style="padding-top: 5px;">
		          <li class="nav" style="display: inline;">
		            <p>CopyRight@201624131105</p>
		          </li>
		        </ul>
		        
		      </div>
		    </header>
		    </nav>
<%-- <script type="text/javascript">
function savemessage() {
	$.post(
		"<%=basePath%>lost/losmessage",
		$("#messageForm").serialize(),
		function (data) {
			alert("添加成功!");
			window.location.reload();
		}
	);
}
</script> --%>
</body>
</html>
